<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<title>致一年未见的你</title>
	<link rel="stylesheet" href="css/common.css">
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/notReturnFactorCommon.js"></script>
	<script type="text/javascript" src="../../../js/common/common.js"></script>
	<script type="text/javascript" src="../../../js/common/wechatCommon.js"></script>
	<style type="text/css">
		.next-btn{
			position: absolute;
			bottom:-10px;
			left: 50%;
			right:50%;
			transform: translate(-50%, -50%);
			display: block;
			width: 210px;
			height: 35px;
			line-height: 35px;
			margin:0 auto;
			background: #1fbad6;
			border-radius: 5px;
			color:#fff;
			text-align: center;
			margin-top:12px;
			color:#fff;
			-webkit-box-shadow:0 2px 0 #049fb3;
		}
		textarea{padding:5px;background: #fff;}
		.sucwrap{padding:2% 10%;color:#fff;background: url(images/suc_02.png) no-repeat;background-size: 100% 100%;}
		.suc_tip{font-size: 16px;font-weight: bold}
		.footer{position: absolute;bottom:0;}

		/*model 样式*/
		.model{
			width: 100%;
		    height: 100%;
		    background: rgba(0, 0, 0, 0.9);
		    position: fixed;
		    top: 0;
		    left: 0;
		    z-index:1;
		    display:block;
		}
		.model-wrap{
			position: absolute;
			left:50%;
			top:50%;
			transform: translate(-50%, -50%);
			width:310px;
			color: #838282;
		}
		.extract_btn{
			display: block;
		    width: 200px;
		    height: 52px;
		    margin: auto;
		    line-height: 49px;
		    position: relative;
		    bottom: 65px;
		}
	</style>
</head>
<body>
	<div class="por">
		<div class="contentwrap">
			<p class="title">12,您对本次售后服务有什么看法？请您简要留下宝贵建议</p>
			<p>
				<textarea class="wid-90 padd-5" style="background: #fff" cols="30" rows="10"></textarea>
			</p>
		</div>
		<a class="next-btn">提交</a>
	</div>
	<!-- model start-->
	<div class="model">
		<div class="model-wrap">
			<div class="pic width-90 auto">
				<img src="images/extract.png" alt="">
				<a class="extract_btn" onclick="draw()" href="javascript:void(0);"></a>
			</div>
		</div>
	</div>
	<!-- model end-->	
</body>
<script>

	var rootPath = getRootPath();

	function draw(){
		$.ajax({
			headers:{'Cookie':document.cookie},
			type:"POST", 
//		    url:"http://127.0.0.1:9013/pointActivity/api/v1/drawLottery",
	        url:rootPath + "/pointActivity/api/v1/drawLottery",
	        dataType:"json",
	        contentType:"application/json",
	        beforeSend: function(){    
	        	 $(".extract_btn").unbind(); //取消事件
	        	},
	        success:function(data){
	        	if(data.drawMessage == "YN" || data.drawMessage == "NO"){
// 	        		window.location.replace(rootPath + "/views/gmmcActivity/NotReturnFactory/fail.html?random=" + parseInt(10000 * Math.random())";	
	        		window.location.replace(rootPath + "/views/gmmcActivity/NotReturnFactory/fail.html?random=" + parseInt(10000 * Math.random()));	
	        		}
	        	else if(data.drawMessage == "YY" || data.drawMessage == "YES"){
// 	        		window.location.href = rootPath + "/views/gmmcActivity/NotReturnFactory/prize.html?random=" + parseInt(10000 * Math.random())";
	        		window.location.replace(rootPath + "/views/gmmcActivity/NotReturnFactory/prize.html?random=" + parseInt(10000 * Math.random()));	
	        		}
	        	else if(data.drawMessage == "1"){
	        		showAlert("无法获取您的地理位置信息！");
	        		}
	        	else if(data.drawMessage == "2"){
	        		showAlert("对不起！查询抽奖记录失败！");
	        		}
	        	else if(data.drawMessage == "3"){
	        		showAlert("对不起！抽奖失败！");
	        		}
	        	else if(data.drawMessage == "4"){
	        		showAlert("对不起！抽奖活動已結束！");
	        		}
	        	else{
	        		showAlert("抽奖流程异常！");
	        		}
	        	},
	        	complete: function(){
	        		$(".extract_btn").bind();  //绑定事件
	        		}
			});
	}
// 		$('.extract_btn').click(function(){
// 			$.ajax({
// 				headers:{'Cookie':document.cookie},
// 				type:"POST", 
// 		        url:"http://127.0.0.1:9013/pointActivity/api/v1/drawLottery",
// 		        url:rootPath + "/pointActivity/api/v1/drawLottery",
// 		        dataType:"json",
// 		        contentType:"application/json",
// 		        beforeSend: function(){    
// 		        	 $(".extract_btn").unbind(); //取消事件
// 		        	},
// 		        success:function(data){
// 		        	if(data.drawMessage == "YN" || data.drawMessage == "NO"){
// 		        		window.location.href = rootPath + "/views/gmmcActivity/NotReturnFactory/fail.html";	
// 		        		}
// 		        	else if(data.drawMessage == "YY" || data.drawMessage == "YES"){
// 		        		window.location.href = rootPath + "/views/gmmcActivity/NotReturnFactory/prize.html";
// 		        		}
// 		        	else if(data.drawMessage == "1"){
// 		        		showAlert("无法获取您的地理位置信息！");
// 		        		}
// 		        	else if(data.drawMessage == "2"){
// 		        		showAlert("对不起！查询抽奖记录失败！");
// 		        		}
// 		        	else if(data.drawMessage == "3"){
// 		        		showAlert("对不起！抽奖失败！");
// 		        		}
// 		        	else{
// 		        		showAlert("抽奖流程异常！");
// 		        		}
// 		        	},
// 		        	complete: function(){
// 		        		$(".extract_btn").bind();  //绑定事件
// 		        		}
// 				});
// 			});
</script>
</html>